{% extends 'base.html' %}

{% block head %}
   
{% endblock %}
    <link rel="stylesheet" href="{{ url_for('static',filename='css/question.css') }}">
{% block title %}项目添加{% endblock %}

{% block main %}
    {% if a %}
        <script language="javascript"> //JavaScript脚本标注
        alert("上传完成");//在页面上弹出上联
        </script>
    {% endif %} 
    {% if b %}
        <script language="javascript"> //JavaScript脚本标注
        alert("删除成功");//在页面上弹出上联
        </script>
    {% endif %} 
    <h3 class="page-title">上传附件：</h3>
    <div>
        <form action="{{ url_for('add_file',question_id=question.id) }}" method="post" enctype=multipart/form-data style="">
            
            <p>
                <input type=file name=file style="float: left" >       
                <input type=submit value=添加附件>
            </p>
        </form>
     </div>
    <div>
    {% if question.file %}
    <h3>已上传附件</h3>
        {% for li in question.file %}
            <li style="float: left;margin-right: 10px; ">{{ li.name }}</li>
            <a href="{{ url_for('delete_file', file_name=li.content,question_id=question.id) }}">del</a><br>  
        {% endfor %}
    </div>
    {% endif %} 
{% endblock %}